package br.com.mtech.ctrlliberty.ejb.util;

import java.util.Arrays;
import java.util.List;

import br.com.mtech.ctrlliberty.clientjar.entity.InternetVO;
import br.com.mtech.ctrlliberty.clientjar.entity.LigacaoVO;
import br.com.mtech.ctrlliberty.clientjar.entity.MensagemVO;

import com.google.gson.Gson;

public class JsonUtil {
	
	public static List<LigacaoVO> toLigacao (String json) {
		
		Gson gson = new Gson();
		
		LigacaoVO[] arrLigacao = gson.fromJson(json, LigacaoVO[].class);
		
		return Arrays.asList(arrLigacao);
	}
	
	public static List<MensagemVO> toMensagem (String json) {
		
		Gson gson = new Gson();
		
		MensagemVO[] arrLigacao = gson.fromJson(json, MensagemVO[].class);
		
		return Arrays.asList(arrLigacao);
	}
	
	public static List<InternetVO> toInternet (String json) {
		
		Gson gson = new Gson();
		
		InternetVO[] arrLigacao = gson.fromJson(json, InternetVO[].class);
		
		return Arrays.asList(arrLigacao);
	}

}
